"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const action_1 = require("../../action");
exports.Init = 'model-common-初始化';
exports.Fetch_Init = 'init';
exports.initAction = (other = action_1.defaultActionParam) => ({
    type: exports.Init,
    payload: {
        fetch: exports.Fetch_Init,
        mandatory: other.mandatory,
    },
    UUID: other.UUID,
});
exports.connect = (dispatch, connected, mapKeys) => (Object.assign({}, connected, { _m_common_init: (other) => dispatch(exports.initAction(other)) }));
const defaultState = {};
const ACTIONS_HANDLER = {};
function commonReducer(state = defaultState, action) {
    const handler = ACTIONS_HANDLER[action.type];
    return handler ? handler(state, action) : state;
}
exports.commonReducer = commonReducer;
